package com.lguplus.servicepoi.gisp;

import com.lguplus.servicepoi.util.Util;

public class ImageMapResponse  extends MessageHeader{
	
	private String cpCode;
	private String serviceCode;
	private String requestorID;
	private short resultCode;
	private short errorCode;
	private String errorMessage;
	private int x;
	private int y;
	private String signAddress;
	private int scale;
	private byte[] image;
	
	public ImageMapResponse() {
		this.cpCode = "";
		this.serviceCode = "";
		this.requestorID = "";
		this.resultCode = 0;
		this.errorCode = 0;
		this.errorMessage = "";
		this.x = 0;
		this.y = 0;
		this.signAddress = "";
		this.scale = 0;
		this.image = null;
	}
	
	public void setBytes(byte[] barr) throws Exception{
		this.setCpCode(Util.GetSubString(barr, 0, 12));
		this.setServiceCode(Util.GetSubString(barr, 12, 12));
		this.setRequestorID(Util.GetSubString(barr, 24, 12));
		this.setResultCode(Util.GetSubShort(barr, 36));
		this.setErrorCode(Util.GetSubShort(barr, 38));
		this.setErrorMessage(Util.GetSubString(barr, 40, 64));
		this.setX(Util.GetSubInt(barr, 104));
		this.setY(Util.GetSubInt(barr, 108));
		this.setSignAddress(Util.GetSubString(barr, 112, 64));
		this.setScale(Util.GetSubInt(barr, 176));
	}

	public byte[] getImage() {
		return image;
	}

	public void setImage(byte[] image) {
		this.image = image;
	}

	public String getCpCode() {
		return cpCode;
	}

	public void setCpCode(String cpCode) {
		this.cpCode = cpCode;
	}

	public String getServiceCode() {
		return serviceCode;
	}

	public void setServiceCode(String serviceCode) {
		this.serviceCode = serviceCode;
	}

	public String getRequestorID() {
		return requestorID;
	}

	public void setRequestorID(String requestorID) {
		this.requestorID = requestorID;
	}

	public short getResultCode() {
		return resultCode;
	}

	public void setResultCode(short resultCode) {
		this.resultCode = resultCode;
	}

	public short getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(short errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public String getSignAddress() {
		return signAddress;
	}

	public void setSignAddress(String signAddress) {
		this.signAddress = signAddress;
	}

	public int getScale() {
		return scale;
	}

	public void setScale(int scale) {
		this.scale = scale;
	}
	
	
}
